package sz.szsmk.citizencard.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.WindowManager;


import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.ui.dialogs.PolicyDialog;


/**
 * 类名称:
 * 类描述:
 * 创建人: Tanning
 * 创建时间:  2021/1/21
 * 创建备注：
 * 创建版本:  v1.0
 * 修改人: Tanning
 * 修改时间:  2021/1/21
 * 修改备注:
 * Copyright 2020 lianchuang
 */
public class PolicyTranslateActivity extends Activity {


    @Override
    protected void onCreate(  Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

        setContentView(R.layout.activity_translate);

        PolicyDialog policyDialog = new PolicyDialog(PolicyTranslateActivity.this);
        policyDialog.showDialog(PolicyTranslateActivity.this);
        policyDialog.setOnAgreeBtnClickListener(new PolicyDialog.OnAgreeBtnClickListener() {
                @Override
                public void onClick() {
                    setResult(RESULT_OK);
                    finish();
                }
        });

        policyDialog.setOnDisagreeBtnClickListener(new PolicyDialog.OnDisagreeBtnClickListener() {
            @Override
            public void onClick() {
                setResult(RESULT_CANCELED);
                finish();
            }
        });

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode==KeyEvent.KEYCODE_BACK) {
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
